﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;
using System.Data;

namespace BLL
{
    public class ModelColumnExtendConfigBLL: BaseBLL
    {
        public ModelColumnExtendConfigBLL(LoginInfo info)
        {
            loginInfo = info;
        }
        public void BeforeInsert(string modelTableID)
        {
            new ModelColumnExtendConfigDAL(loginInfo).BeforeInsert(modelTableID);
        }
          
        public bool Update(ModelColumnExtendConfig data)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).Update(data);
        }

        public string SaveAndCreateView(DataTable dt, DataTable dtOpts, string modelTableId)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).SaveAndCreateView(dt,dtOpts, modelTableId);
        }

        public bool ColumnNameIsExist(string guid, string modelTableID, string columnName)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).ColumnNameIsExist(guid, modelTableID, columnName);
        }

        public bool Delete(string guid)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).Delete(guid);
        }

        public IList<ModelColumnExtendConfig> GetList(string modelTableID)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).GetList(modelTableID);
        }

        public ModelColumnExtendConfig LoadByGuid(string guid)
        {
            return new ModelColumnExtendConfigDAL(loginInfo).LoadByGuid(guid);
        }
    }
}
